Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Scripting Additions Guide /
Chapter 2 - Scripting Addition Commands / Command Definitions
/


List Folder

The List Folder command returns a list of every file and folder in a specified folder or volume. List Folder is one of several commands provided by the File Commands scripting addition.

SYNTAX
list folder referenceToFolder
PARAMETER
referenceToFolder
A reference of the form file nameString, alias nameString, or folder nameString (see "Notes").
Class: Reference or string
RESULT
A list of strings.

EXAMPLE
list folder "My Disk:"--result: {"Letters", "Current", "Projects", "Aliases"}
NOTES
To specify the name (nameString) of a folder, use a string of the form "Disk:Folder1:Folder2:...:FolderName" as described in Chapter 5, "Objects and References," of the AppleScript Language Guide. If you specify only the name of the folder (FolderName) instead of its entire pathname, AppleScript attempts to find the folder in the current directory.

ERRORS
Error
number
Error message
-35Disk <name> wasn't found.
-37Bad name for file.
-43File <name> wasn't found.
-50Parameter error.
-108Out of memory.
-120Folder <name> wasn't found.
-1700Can't make some data into the expected type.
-1701Some parameter is missing for <commandName>.
-1703Some data was the wrong type.
-1704Some parameter was invalid.
-1705Operation involving a list item failed.
-1718Reply has not yet arrived.
-1719Can't get <reference>. Invalid index.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
18 DEC 1996